<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .box1 {
            width: 100px;
            height: 100px;
            background-color: black;
            opacity: 0.5; /*透明度*/
            /*绝对定位 不会保留原来的位*/
            /*position: absolute;*/
            /*left: 150px;*/
            /*top: 150px;*/
        }

        .box2 {
            width: 200px;
            height: 200px;
            background-color: green;
            position: absolute;
            left: 150px;
            top: 150px;
        }

        .box3 {
            width: 100px;
            height: 100px;
            background-color: purple;
            position: absolute;
            top: 50px;
        }
    </style>
</head>
<body>
<div class="box1"></div>
<div class="box2">
  <div class="box3">

  </div>
</div>
</body>
</html>